<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>展示人物信息</title>
        <script>
            // 第一题
            function Persion(name,age){
                this.name=name;
                this.age=age;
                this.show=function(){
                    document.write("我是"+this.name+"今年"+this.age+"岁"+"<br>");
        
                }
            }
            //第二题
            var a=new Persion("张三",20);
            a.show()
        
            // 第三题
            var b = {
                show:function (name,age){
                    document.write("姓名是"+name+"年龄是"+age+"<br>");
                }
            }
            b.show("李四",20);
        
        
        
            // 第四题
            var student = {
                name:"王二",
                age:18,
                sex:"男",
                addr:"淮阳",
                tel:999999999,
                show:function(){
                    alert("你好");
                }
               
            }
            for(const i in student) {
                    document.write(i+"="+student[i]+"<br>");
                }
        </script>
    
</head>
<body>
    
</body>
</html>